FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

do_patch() {
    # add pfe-slave patch
    if ${@bb.utils.contains('DISTRO_FEATURES', 'pfe-slave', 'true', 'false', d)}; then
            file = "0001-configs-Updates-required-for-PFE-slave-instance.patch"
            patch_file = "${WORKDIR}/$file"
            dest_file = "${S}/$file"
            cp $patch_file $dest_file
            patch -p1 < $dest_file
    fi
}

addtask patch after do_unpack before do_configure